package cn.com.surker.platform.dao;

import cn.com.surker.platform.entity.PlatformUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2022-03-01
 */
public interface PlatformUserDao extends BaseMapper<PlatformUser> {

    /**
     * 根据openid修改公众号openid和头像
     * @param openid
     * @param accountOpenid
     * @param avatarUrl
     * @return
     */
    Integer updateByOpenid(String openid, String accountOpenid, String avatarUrl);

    /**
     * 清理未关注用户公众号openid
     * @param openid
     * @return
     */
    Integer updateClearOpenid(String openid);

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    PlatformUser findByOpenid(String openid);

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    PlatformUser findByOpenidOrAccount(String openid);

    /**
     * 根据车牌查询最后签到用户信息
     * @param carNo
     * @return
     */
    PlatformUser findSignCarNo(String carNo);
}
